package com.schoolcloud.share.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.schoolcloud.common.util.UserContext;
import com.schoolcloud.share.entity.Comments;
import com.schoolcloud.share.service.CommentsService;
import com.schoolcloud.share.mapper.CommentsMapper;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;

/**
* @author hongmizfb
* @description 针对表【comments(评论系统)】的数据库操作Service实现
* @createDate 2025-05-16 18:35:15
*/
@Service
public class CommentsServiceImpl extends ServiceImpl<CommentsMapper, Comments>
    implements CommentsService{

    @Override
    public void createComment(Comments comment) {
        comment.setCreateTime(LocalDateTime.now());
        comment.setUserId(UserContext.getUserToInteger());
        save( comment);
    }
}




